package screens;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.component.Menu;
import util.LookAndFeel;

public class SplashScreen extends TransitionScreen{//MainScreen {
	
	public SplashScreen(int transitionType) {
		super(transitionType);
		//TransitionContext.TRANSITION_FADE
		int sec=LookAndFeel.splash_seconds;
		Bitmap img = Bitmap.getBitmapResource(LookAndFeel.splash_img);
		Bitmap img_resized = new Bitmap(Display.getWidth(), Display.getHeight());//FieldHelper.resizeImage(img, getWidth(), getHeight());
		img.scaleInto(img_resized, Bitmap.FILTER_LANCZOS, Bitmap.SCALE_TO_FILL);
		// If LANCZOS takes too long, replace with BILINEAR (lower quality)
		add(new BitmapField(img_resized));
		try {
			Thread.sleep(sec);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
        UiApplication.getUiApplication().pushScreen(new ConfigurationScreen());
	}
	
	protected void makeMenu(Menu menu, int instance){
		menu.deleteAll();
		super.makeMenu(menu, instance);
	}
	

	protected boolean navigationClick(int status, int time){
		return true;
	}
	protected boolean navigationUnclick(int status, int time){
		return true;
	}
	
}
